import React from 'react';
import { Table, Image, Space } from 'antd';
import { downloadImage } from '@/utils/help';

function PureRedux() {
  const dataSource = [
    {
      contentId: '24076958',
      contentType: 'EduBook',
      title: 'Our World 1配套绘本',
      desc: '',
      snapshotUrl:
        'http://res.iiiview.net/ugc/file/2020/11/19/80ab50ddd3124dbf95350a6a39b1db8e.jpg',
      sortWeight: '1',
      parentId: '0',
      lessonId: '0',
      lessonCount: '9',
      bookType: 'book',
      voiceAssess: 'none',
      shareId: '22112743',
      pointRead: 'none',
      mediaId: '24076958',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: '2hkhipst8i1o6yvv9meqndi5hlpu62x2',
      srcCode: '2hkhipst8i1o6yvv9meqndi5hlpu62x2',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '24036066',
      contentType: 'EduBook',
      title: 'Our World 1 练习册阅读',
      desc: '',
      snapshotUrl:
        'http://res.iiiview.net/ugc/file/2020/11/18/e540d546fe7443b28a79446ec6652fd9.jpg',
      sortWeight: '2',
      parentId: '0',
      lessonId: '0',
      lessonCount: '9',
      bookType: 'book',
      voiceAssess: 'none',
      shareId: '22093137',
      pointRead: 'none',
      mediaId: '24036066',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: 'qfi7css12ck5bv8hm9zw3jw92qdnzx3s',
      srcCode: 'qfi7css12ck5bv8hm9zw3jw92qdnzx3s',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '24036075',
      contentType: 'EduBook',
      title: 'Our World 2 练习册阅读',
      desc: '',
      snapshotUrl:
        'http://res.iiiview.net/ugc/file/2020/11/18/a15df64956524fc98fe94e78ed6660a5.jpg',
      sortWeight: '3',
      parentId: '0',
      lessonId: '0',
      lessonCount: '9',
      bookType: 'book',
      voiceAssess: 'none',
      shareId: '22093136',
      pointRead: 'none',
      mediaId: '24036075',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: 'm349bnc72b2xswx6qw43isktc2od6f4o',
      srcCode: 'm349bnc72b2xswx6qw43isktc2od6f4o',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '23477357',
      contentType: 'EduBook',
      title: 'Our World 2 配套绘本',
      desc: '',
      snapshotUrl:
        'http://res.iiiview.net/ugc/file/2020/11/19/04cefa18d00e41de810069a4c4a18ce6.jpg',
      sortWeight: '4',
      parentId: '0',
      lessonId: '0',
      lessonCount: '9',
      bookType: 'book',
      voiceAssess: 'none',
      shareId: '21865012',
      pointRead: 'none',
      mediaId: '23477357',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: '4fhnrj5guh77ne42bhw3s3hlgnkpdyy8',
      srcCode: '4fhnrj5guh77ne42bhw3s3hlgnkpdyy8',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '22863545',
      contentType: 'EduBook',
      title: 'Our World Starter',
      desc: '',
      snapshotUrl: 'http://res.iiiview.net/ugc/file/2018/7/24/d4e4cfd7214047cc81510b08c6d0dd2d.png',
      sortWeight: '5',
      parentId: '0',
      lessonId: '0',
      lessonCount: '114',
      bookType: 'book',
      voiceAssess: 'ok',
      shareId: '21560946',
      pointRead: 'ok',
      mediaId: '22863545',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: 'gxy4zfhpi457nsrlaikripobil2kw6v0',
      srcCode: 'gxy4zfhpi457nsrlaikripobil2kw6v0',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '22863541',
      contentType: 'EduBook',
      title: 'Our World 2',
      desc: '',
      snapshotUrl:
        'http://res.iiiview.net/ugc/file/2017/07/20/n66i2dat9cslz00xvphppullahm8y3kl.jpg',
      sortWeight: '6',
      parentId: '0',
      lessonId: '0',
      lessonCount: '81',
      bookType: 'book',
      voiceAssess: 'ok',
      shareId: '21560947',
      pointRead: 'ok',
      mediaId: '22863541',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: 'leglq11raahgu5vb7ajgswna3ax0tdaj',
      srcCode: 'leglq11raahgu5vb7ajgswna3ax0tdaj',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '22863539',
      contentType: 'EduBook',
      title: 'Our World 1',
      desc: '',
      snapshotUrl:
        'http://res.iiiview.net/ugc/file/2018/12/21/03888ef7842e47398dccf6e0aefdb4a7.jpg',
      sortWeight: '7',
      parentId: '0',
      lessonId: '0',
      lessonCount: '126',
      bookType: 'book',
      voiceAssess: 'ok',
      shareId: '21560948',
      pointRead: 'ok',
      mediaId: '22863539',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: '97wg9ywkfi0apb1hnoblqrtmpklbob6a',
      srcCode: '97wg9ywkfi0apb1hnoblqrtmpklbob6a',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '23566908',
      contentType: 'EduBook',
      title: 'Our World 6',
      desc: '',
      snapshotUrl:
        'http://res.iiiview.net/ugc/file/2017/09/19/1xhwhpbh483f7wz8dj6llithxljcm3se.jpg',
      sortWeight: '8',
      parentId: '0',
      lessonId: '0',
      lessonCount: '79',
      bookType: 'book',
      voiceAssess: 'ok',
      shareId: '21897253',
      pointRead: 'ok',
      mediaId: '23566908',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: '6reept8kmvusy4bdy5budimgam0lhtr9',
      srcCode: '6reept8kmvusy4bdy5budimgam0lhtr9',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '23566903',
      contentType: 'EduBook',
      title: 'Our World 5',
      desc: '',
      snapshotUrl: 'http://res.iiiview.net/ugc/file/2019/3/29/adfc345969f348f691c664c6233ba4c4.jpg',
      sortWeight: '9',
      parentId: '0',
      lessonId: '0',
      lessonCount: '82',
      bookType: 'book',
      voiceAssess: 'ok',
      shareId: '21897252',
      pointRead: 'ok',
      mediaId: '23566903',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: '8hfldzy1eezedbbwlsvmgnzjye05izfq',
      srcCode: '8hfldzy1eezedbbwlsvmgnzjye05izfq',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '23566900',
      contentType: 'EduBook',
      title: 'Our World 4',
      desc: '',
      snapshotUrl:
        'http://res.iiiview.net/ugc/file/2017/09/19/19oxwlfboholxowu8y6564daedtrumx5.jpg',
      sortWeight: '10',
      parentId: '0',
      lessonId: '0',
      lessonCount: '73',
      bookType: 'book',
      voiceAssess: 'ok',
      shareId: '21897251',
      pointRead: 'ok',
      mediaId: '23566900',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: 'es7k9n5elajspoulwly8h2x6nzhs6jhb',
      srcCode: 'es7k9n5elajspoulwly8h2x6nzhs6jhb',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
    {
      contentId: '23566898',
      contentType: 'EduBook',
      title: 'Our World 3',
      desc: '',
      snapshotUrl:
        'http://res.iiiview.net/ugc/file/2017/06/07/5zvf2boo5uj1rz6txvk70rf2zijo4itk.jpg',
      sortWeight: '11',
      parentId: '0',
      lessonId: '0',
      lessonCount: '68',
      bookType: 'book',
      voiceAssess: 'ok',
      shareId: '21897250',
      pointRead: 'ok',
      mediaId: '23566898',
      user: {
        userId: '118983',
        serverId: '0',
        nickname: 'adminlwnyy',
        username: 'adminlwnyy',
        photourl:
          'http://res.iiiview.net/photo/118983/20171121/2FC65D76-30D7-4045-89E7-C72AC082E3D1.png',
        instId: '20229',
        role: 'groupAdmin',
        mobile: '18779355966',
        txImUserId: '3_118983',
        gender: '0',
        lastAccessTime: '0',
        hxUsername: 't_118983',
        isvalidate: 'true',
        activeDate: '2017-11-17 11:33:25',
        location: {
          province: '广东省',
          city: '深圳市',
          area: '深圳市',
          longitude: '113.854497',
          latitude: '22.570468',
        },
        awarded: '0',
        headUserId: '0',
        wyAccid: 't_118983',
        instCode: '',
        roleId: '0',
        age: '0',
        expiredStatus: '0',
        campusId: '235',
        campusTitle: '蓝蜗牛英语',
        campusShortTitle: '',
        campusType: 'main_campus',
        inInstCreateDate: '2017-11-17 11:33:26',
        isShadowUser: '0',
        userType: '0',
        studentOrigin: '0',
        flower: '0',
        hasForeignTeacher: 'false',
      },
      folderId: '0',
      code: 'exus8xzas8xy1qf8v6g60zo5matrx81r',
      srcCode: 'exus8xzas8xy1qf8v6g60zo5matrx81r',
      inst: '0',
      sourceType: 'app',
      openType: 'open_1',
      hasGate: 'false',
      instCode: 'lwnyy',
      hasRelated: 'false',
      public: 'false',
    },
  ];
  const columns = [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      render: (text, record, index) => index,
    },
    {
      title: '标题',
      dataIndex: 'title',
      key: 'title',
    },
    {
      title: '背景图片',
      dataIndex: 'snapshotUrl',
      key: 'snapshotUrl',
      render: (snapshotUrl) => <Image width={50} src={snapshotUrl} />,
    },
    {
      title: '操作',
      dataIndex: 'action',
      key: 'action',
      render: (text, record) => (
        <Space size="small">
          <span onClick={() => downloadImage(record.snapshotUrl, record.title)}>下载</span>
        </Space>
      ),
    },
  ];
  const pagination = { pageSize: 20 };
  return (
    <Table
      dataSource={dataSource}
      size="small"
      rowKey={(record) => record.contentId}
      columns={columns}
      pagination={pagination}
    />
  );
}

export default PureRedux;
